<!-- 我的 - 企业认证 -->
<template>
  <view>
    <z-navbar title="企业认证" :border-bottom="true" />
    <template v-if="!state.loading">
      <EnterpriseAuthAdd v-if="!state.detailData || state.reSubmit" :data="state.detailData " />
      <EnterpriseAuthDetail v-else :data="state.detailData" @reSubmit="state.reSubmit = true" />
    </template>
  </view>
</template>

<script setup>
import EnterpriseAuthAdd from '@/package_user/components/enterprise-auth-add.vue'
import EnterpriseAuthDetail from '@/package_user/components/enterprise-auth-detail.vue'
import { getEnterpriseAuthDetail } from '@/common/http/module/user'

const state = reactive({
  loading: true,
  reSubmit: false,
  detailData: ''
})

function loadData() {
  state.loading = true
  getEnterpriseAuthDetail().then(res => {
    state.detailData = res.data
    state.loading = false
  }).catch(() => {
    state.loading = false
  })
}

onLoad(() => loadData())
</script>

<style lang="scss" scoped>
.option-item {
  display: flex;
  color: #333;
  font-size: 28rpx;
  font-family: PingFangSC-Medium;
}
</style>
